3.2.14 \(\int \sin (x) \sqrt {1+\sin ^2(x)} \, dx\) [114]

Optimal. Leaf size=30 \[ -\sin ^{-1}\left (\frac {\cos (x)}{\sqrt {2}}\right )-\frac {1}{2} \cos (x) \sqrt {2-\cos ^2(x)} \]

[Out]

-arcsin(1/2*cos(x)*2^(1/2))-1/2*cos(x)*(2-cos(x)^2)^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.02, antiderivative size = 30, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.231, Rules used = {3265, 201, 222} \begin {gather*} -\text {ArcSin}\left (\frac {\cos (x)}{\sqrt {2}}\right )-\frac {1}{2} \cos (x) \sqrt {2-\cos ^2(x)} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Sin[x]*Sqrt[1 + Sin[x]^2],x]

[Out]

-ArcSin[Cos[x]/Sqrt[2]] - (Cos[x]*Sqrt[2 - Cos[x]^2])/2

Rule 201

Int[((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[x*((a + b*x^n)^p/(n*p + 1)), x] + Dist[a*n*(p/(n*p + 1)),
 Int[(a + b*x^n)^(p - 1), x], x] /; FreeQ[{a, b}, x] && IGtQ[n, 0] && GtQ[p, 0] && (IntegerQ[2*p] || (EqQ[n, 2
] && IntegerQ[4*p]) || (EqQ[n, 2] && IntegerQ[3*p]) || LtQ[Denominator[p + 1/n], Denominator[p]])

Rule 222

Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Simp[ArcSin[Rt[-b, 2]*(x/Sqrt[a])]/Rt[-b, 2], x] /; FreeQ[{a, b}
, x] && GtQ[a, 0] && NegQ[b]

Rule 3265

Int[sin[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^(p_.), x_Symbol] :> With[{ff = Free
Factors[Cos[e + f*x], x]}, Dist[-ff/f, Subst[Int[(1 - ff^2*x^2)^((m - 1)/2)*(a + b - b*ff^2*x^2)^p, x], x, Cos
[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, p}, x] && IntegerQ[(m - 1)/2]

Rubi steps

\begin {align*} \int \sin (x) \sqrt {1+\sin ^2(x)} \, dx &=-\text {Subst}\left (\int \sqrt {2-x^2} \, dx,x,\cos (x)\right )\\ &=-\frac {1}{2} \cos (x) \sqrt {2-\cos ^2(x)}-\text {Subst}\left (\int \frac {1}{\sqrt {2-x^2}} \, dx,x,\cos (x)\right )\\ &=-\sin ^{-1}\left (\frac {\cos (x)}{\sqrt {2}}\right )-\frac {1}{2} \cos (x) \sqrt {2-\cos ^2(x)}\\ \end {align*}

________________________________________________________________________________________

Mathematica [C] Result contains complex when optimal does not.
time = 0.04, size = 53, normalized size = 1.77 \begin {gather*} -\frac {\cos (x) \sqrt {3-\cos (2 x)}}{2 \sqrt {2}}+i \log \left (i \sqrt {2} \cos (x)+\sqrt {3-\cos (2 x)}\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Sin[x]*Sqrt[1 + Sin[x]^2],x]

[Out]

-1/2*(Cos[x]*Sqrt[3 - Cos[2*x]])/Sqrt[2] + I*Log[I*Sqrt[2]*Cos[x] + Sqrt[3 - Cos[2*x]]]

________________________________________________________________________________________

Maple [A]
time = 5.52, size = 51, normalized size = 1.70

method result size
default \(-\frac {\sqrt {\left (1+\sin ^{2}\left (x \right )\right ) \left (\cos ^{2}\left (x \right )\right )}\, \left (\sqrt {-\left (\cos ^{4}\left (x \right )\right )+2 \left (\cos ^{2}\left (x \right )\right )}+\arcsin \left (\cos ^{2}\left (x \right )-1\right )\right )}{2 \cos \left (x \right ) \sqrt {1+\sin ^{2}\left (x \right )}}\) \(51\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sin(x)*(1+sin(x)^2)^(1/2),x,method=_RETURNVERBOSE)

[Out]

-1/2*((1+sin(x)^2)*cos(x)^2)^(1/2)*((-cos(x)^4+2*cos(x)^2)^(1/2)+arcsin(cos(x)^2-1))/cos(x)/(1+sin(x)^2)^(1/2)

________________________________________________________________________________________

Maxima [A]
time = 0.56, size = 25, normalized size = 0.83 \begin {gather*} -\frac {1}{2} \, \sqrt {-\cos \left (x\right )^{2} + 2} \cos \left (x\right ) - \arcsin \left (\frac {1}{2} \, \sqrt {2} \cos \left (x\right )\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(x)*(1+sin(x)^2)^(1/2),x, algorithm="maxima")

[Out]

-1/2*sqrt(-cos(x)^2 + 2)*cos(x) - arcsin(1/2*sqrt(2)*cos(x))

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 71 vs. \(2 (25) = 50\).
time = 0.41, size = 71, normalized size = 2.37 \begin {gather*} -\frac {1}{2} \, \sqrt {-\cos \left (x\right )^{2} + 2} \cos \left (x\right ) + \frac {1}{2} \, \arctan \left (-\frac {\cos \left (x\right ) \sin \left (x\right ) - {\left (\cos \left (x\right )^{3} - \cos \left (x\right )\right )} \sqrt {-\cos \left (x\right )^{2} + 2}}{\cos \left (x\right )^{4} - 3 \, \cos \left (x\right )^{2} + 1}\right ) - \frac {1}{2} \, \arctan \left (\frac {\sin \left (x\right )}{\cos \left (x\right )}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(x)*(1+sin(x)^2)^(1/2),x, algorithm="fricas")

[Out]

-1/2*sqrt(-cos(x)^2 + 2)*cos(x) + 1/2*arctan(-(cos(x)*sin(x) - (cos(x)^3 - cos(x))*sqrt(-cos(x)^2 + 2))/(cos(x
)^4 - 3*cos(x)^2 + 1)) - 1/2*arctan(sin(x)/cos(x))

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \sqrt {\sin ^{2}{\left (x \right )} + 1} \sin {\left (x \right )}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(x)*(1+sin(x)**2)**(1/2),x)

[Out]

Integral(sqrt(sin(x)**2 + 1)*sin(x), x)

________________________________________________________________________________________

Giac [A]
time = 0.47, size = 25, normalized size = 0.83 \begin {gather*} -\frac {1}{2} \, \sqrt {-\cos \left (x\right )^{2} + 2} \cos \left (x\right ) - \arcsin \left (\frac {1}{2} \, \sqrt {2} \cos \left (x\right )\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(x)*(1+sin(x)^2)^(1/2),x, algorithm="giac")

[Out]

-1/2*sqrt(-cos(x)^2 + 2)*cos(x) - arcsin(1/2*sqrt(2)*cos(x))

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.03 \begin {gather*} \int \sin \left (x\right )\,\sqrt {{\sin \left (x\right )}^2+1} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sin(x)*(sin(x)^2 + 1)^(1/2),x)

[Out]

int(sin(x)*(sin(x)^2 + 1)^(1/2), x)

________________________________________________________________________________________